import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { DeviceController } from './appController';
import { DeviceService } from './app.service';
import {Device} from "./DbModel/device.entity";

const typeOrmModule = TypeOrmModule.forRoot({
  type: 'sqlite',
  database: './device.db',
  entities: [Device],
  synchronize: true, // 确保每次运行应用程序时实体都将与数据库同步
})

@Module({
  imports: [typeOrmModule, TypeOrmModule.forFeature([Device])],
  controllers: [DeviceController],
  providers: [DeviceService],
})
export class AppModule {}
